--- id: TASK-023 title: 'Toggle checkbox state with a key (- [ ] <-> - [x])' status: "\U0001F3C1 Done" assignee: [] created_date: '2026-06-29 21:08' updated_date: '2026-06-30 04:40' labels: - feature - release-1 dependencies: [] priority: low ordinal: 23000 --- ## Description From TASK-008 description (deferred, not an AC there): toggle the checkbox on the current list line between [ ] and [x] with a keybind, without hand-editing the brackets. Should work whether or not the cursor is on the brackets; no-op on non-checkbox lines. ## Acceptance Criteria - [x] #1 A keybind toggles the current line's checkbox [ ] <-> [x] - [x] #2 No-op on lines without a checkbox - [x] #3 README/help document the key - [x] #4 Mouse click on the checkbox glyph toggles it - [x] #5 The toggle keybind works with the cursor anywhere on the line (not just on the brackets) ## Implementation Plan 1. RED+GREEN editor.ToggleCheckbox() (lists.go): flip [ ]<->[x] on cursor line any col; no-op non-checkbox. checkboxRange helper via parseListItem boxStart. 2. OnCheckboxBracket() for mouse-glyph hit. 3. Wire Alt+x keybind (dispatch Alt-rune switch + editKindOf kindStructural=undoable). 4. app.handleMouse: press on checkbox glyph -> PushUndo+ToggleCheckbox. 5. Docs README+help.go. ## Implementation Notes Scope expanded per user: toggle by (a) keybind with cursor anywhere on the line, and (b) mouse click on the checkbox glyph. Mouse handling lives in app.go (it owns tea.MouseMsg + margin/scroll->buffer mapping; see MoveToVisual); the toggle mutation itself should be an editor method (e.g. ToggleCheckbox) so it's unit-testable and undoable.